package com.foftact.block;

import com.foftact.Foftact;
import com.foftact.etf.ETFListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.testng.Assert;
import org.testng.annotations.Test;

import java.util.List;

@SpringBootTest(classes= Foftact.class)
public class BlockTestng extends AbstractTestNGSpringContextTests {

    @Autowired
    BlockService blockservice;

    @Autowired
    ETFListService etfListService;

    @Test
    public void test() throws Exception {
        blockservice.fetchAndSaveBlockData();
        List<Block> allBlocks = blockservice.getAllBlocks();
        Assert.assertTrue(allBlocks.size() > 90);
    }

}
